// store.js
import Vue from 'vue';
import Vuex from 'vuex';
import History from './History';
import localStorage from './localStorage';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    response: null, 
  },
  mutations: {
    setResponse(state, response) {
      state.response = response;
    },
  },
  actions: {
    setResponse({ commit }, response) {
      commit('setResponse', response);
    },
  },
  getters: {
    // 获取响应数据
    getResponse(state) {
      return state.response;
    },
  },
  modules:{
    history: History,
  },
  plugins:[localStorage]
});
